This forum is closed to new posts and
responses. Individual names altered for privacy purposes. The information contained in this website is provided for informational purposes only and should not be construed as a forum for customer support requests. Any customer support requests should be directed to the official HCL customer support channels below:
If your XPage is being viewed on the web you can append / insert a column. You can then add a link to that column - see Paul Hannan's article on the XPages blog: http://xpagesblog.com/xpages-blog/tag/viewpanel
You just need to ensure your ViewPanel has a var defined (go to the All Properties box of the View Panel or type into the source pane) - this allows you to get a handle on the row. You also need to ensure the column is bound to an actual column (otherwise you'll get an error) and that it has value="" to suppress the column value from appearing. You can then add a link to the column ("<xp:link></xp:link>" or drag and drop and m it to the column either in the outline or the source pane).
The link url can then be computed to "/0/" + myVar.getDocumen().getUniversalID() + "/$FILE/" + @Subset(@AttachmentNames(),1). This should get a handle on the first attachment name and use the default view to launch it. Because this is a classic web URL the default view needs to be accessible to the web.
Note, from what I've been told, this will not work for XPages in Notes Client because the classic web URL does not work. I believe you can call a function in the XPages code installed with the client (not sure which, I havn't looked) or a link calculating the whole URL may work. You'll need to do some investigation if you need that. I'm sure code to identify if the user is in the Notes Client is readily available, if you need to do different things based on client or web.
Feedback response number WEBB84BK2A created by ~Maria Xanjumiberg on 04/08/2010